package com.zyd.shiro.persistence.mapper;


import com.zyd.shiro.persistence.beans.PakWxUser;
import com.zyd.shiro.plugin.BaseMapper;
import com.zyd.shiro.framework.object.BaseConditionVO;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;



@Repository
public interface PakWxUserMapper extends BaseMapper<PakWxUser> {

    /**
     * 分页查询
     *
     * @param vo
     * @return
     */
    @Select("<script>"+
            "SELECT s.* FROM PAK_WX_USER s WHERE  1 = 1 " +
            " GROUP BY s.id ORDER BY s.create_time DESC " +
            "</script>")
    List<PakWxUser> findPageBreakByCondition(BaseConditionVO vo);

    @Select("<script>"+
            "SELECT s.* FROM PAK_WX_USER s WHERE openid=#{openid} "+
            "</script>")
    PakWxUser findByOpenid(String openid);

    @Select("<script>"+
            "SELECT s.* FROM PAK_WX_USER s WHERE username=#{username} "+
            "</script>")
    PakWxUser findByUsername(String username);
}